/*   1:    */ package org.intellij.lang.regexp.psi.impl;
/*   2:    */ 
/*   3:    */

import com.intellij.lang.ASTNode;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import org.intellij.lang.regexp.RegExpElementTypes;
import org.intellij.lang.regexp.RegExpTT;
import org.intellij.lang.regexp.psi.RegExpAtom;
import org.intellij.lang.regexp.psi.RegExpElementVisitor;
import org.intellij.lang.regexp.psi.RegExpQuantifier;
import org.jetbrains.annotations.NotNull;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */ 
/*  16:    */ public class RegExpQuantifierImpl
/*  17:    */   extends RegExpElementImpl
/*  18:    */   implements RegExpQuantifier
/*  19:    */ {
/*  20:    */   public RegExpQuantifierImpl(ASTNode paramASTNode)
/*  21:    */   {
/*  22: 32 */     super(paramASTNode);
/*  23:    */   }
/*  24:    */   
/*  25:    */   public void accept(RegExpElementVisitor paramRegExpElementVisitor)
/*  26:    */   {
/*  27: 36 */     paramRegExpElementVisitor.visitRegExpQuantifier(this);
/*  28:    */   }
/*  29:    */   
/*  30:    */   @NotNull
/*  31:    */   public RegExpAtom getAtom()
/*  32:    */   {
/*  33: 41 */     ASTNode[] arrayOfASTNode = getNode().getChildren(RegExpElementTypes.ATOMS);
/*  34: 42 */     assert (arrayOfASTNode.length > 0); RegExpAtom 
/*  35: 43 */       tmp43_40 = ((RegExpAtom)arrayOfASTNode[0].getPsi());
/*  36: 43 */     if (tmp43_40 == null) {
/*  37: 43 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getAtom" }));
/*  38:    */     }
/*  39: 43 */     return tmp43_40;
/*  40:    */   }
/*  41:    */   
/*  42:    */   @NotNull
/*  43:    */   public RegExpQuantifier.Count getCount()
/*  44:    */   {
/*  45: 48 */     ASTNode[] arrayOfASTNode1 = getNode().getChildren(RegExpTT.QUANTIFIERS);
/*  46: 49 */     assert (arrayOfASTNode1.length > 0);
/*  47:    */     
/*  48: 51 */     IElementType localIElementType = arrayOfASTNode1[0].getElementType();
/*  49: 52 */     if (localIElementType == RegExpTT.QUEST)
/*  50:    */     {
/*  51: 53 */       RegExpQuantifier.SimpleCount tmp51_48 = RegExpQuantifier.SimpleCount.ONE_OR_ZERO;
/*  52: 53 */       if (tmp51_48 == null) {
/*  53: 53 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/*  54:    */       }
/*  55: 53 */       return tmp51_48;
/*  56:    */     }
/*  57: 54 */     if (localIElementType == RegExpTT.STAR)
/*  58:    */     {
/*  59: 55 */       RegExpQuantifier.SimpleCount tmp96_93 = RegExpQuantifier.SimpleCount.ZERO_OR_MORE;
/*  60: 55 */       if (tmp96_93 == null) {
/*  61: 55 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/*  62:    */       }
/*  63: 55 */       return tmp96_93;
/*  64:    */     }
/*  65: 56 */     if (localIElementType == RegExpTT.PLUS)
/*  66:    */     {
/*  67: 57 */       RegExpQuantifier.SimpleCount tmp141_138 = RegExpQuantifier.SimpleCount.ONE_OR_MORE;
/*  68: 57 */       if (tmp141_138 == null) {
/*  69: 57 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/*  70:    */       }
/*  71: 57 */       return tmp141_138;
/*  72:    */     }
/*  73: 58 */     if (localIElementType == RegExpTT.LBRACE)
/*  74:    */     {
/*  75: 59 */       ASTNode[] arrayOfASTNode2 = getNode().getChildren(TokenSet.create(new IElementType[] { RegExpTT.NUMBER }));
/*  76: 60 */       if (arrayOfASTNode2.length >= 1)
/*  77:    */       {
/*  78: 61 */         String str1 = arrayOfASTNode2[0].getText();
/*  79:    */         String str2;
/*  80: 63 */         if (arrayOfASTNode2.length == 2) {
/*  81: 64 */           str2 = arrayOfASTNode2[1].getText();
/*  82: 65 */         } else if (getNode().findChildByType(RegExpTT.COMMA) != null) {
/*  83: 66 */           str2 = "";
/*  84:    */         } else {
/*  85: 68 */           str2 = str1;
/*  86:    */         }
/*  87: 70 */         void tmp278_275 = new RepeatedCount(str1, str2);
/*  88: 70 */         if (tmp278_275 == null) {
/*  89: 70 */           throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/*  90:    */         }
/*  91: 70 */         return tmp278_275;
/*  92:    */       }
/*  93: 73 */       void tmp324_321 = new RepeatedCount("", "");
/*  94: 73 */       if (tmp324_321 == null) {
/*  95: 73 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/*  96:    */       }
/*  97: 73 */       return tmp324_321;
/*  98:    */     }
/*  99: 76 */     if (!$assertionsDisabled) {
/* 100: 76 */       throw new AssertionError();
/* 101:    */     }
/* 102: 77 */      tmp374_373 = null;
/* 103: 77 */     if (tmp374_373 == null) {
/* 104: 77 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getCount" }));
/* 105:    */     }
/* 106: 77 */     return tmp374_373;
/* 107:    */   }
/* 108:    */   
/* 109:    */   @NotNull
/* 110:    */   public RegExpQuantifier.Type getType()
/* 111:    */   {
/* 112: 82 */     ASTNode[] arrayOfASTNode = getNode().getChildren(RegExpTT.QUANTIFIERS);
/* 113: 83 */     if (arrayOfASTNode.length > 1)
/* 114:    */     {
/* 115: 84 */       IElementType localIElementType = arrayOfASTNode[1].getElementType();
/* 116: 85 */       if (localIElementType == RegExpTT.QUEST)
/* 117:    */       {
/* 118: 86 */         RegExpQuantifier.Type tmp38_35 = RegExpQuantifier.Type.RELUCTANT;
/* 119: 86 */         if (tmp38_35 == null) {
/* 120: 86 */           throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getType" }));
/* 121:    */         }
/* 122: 86 */         return tmp38_35;
/* 123:    */       }
/* 124: 87 */       if (localIElementType == RegExpTT.PLUS)
/* 125:    */       {
/* 126: 88 */         RegExpQuantifier.Type tmp83_80 = RegExpQuantifier.Type.POSSESSIVE;
/* 127: 88 */         if (tmp83_80 == null) {
/* 128: 88 */           throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getType" }));
/* 129:    */         }
/* 130: 88 */         return tmp83_80;
/* 131:    */       }
/* 132:    */     }
/* 133: 91 */     RegExpQuantifier.Type tmp121_118 = RegExpQuantifier.Type.GREEDY;
/* 134: 91 */     if (tmp121_118 == null) {
/* 135: 91 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl", "getType" }));
/* 136:    */     }
/* 137: 91 */     return tmp121_118;
/* 138:    */   }
/* 139:    */   
/* 140:    */   private static class RepeatedCount
/* 141:    */     implements RegExpQuantifier.Count
/* 142:    */   {
/* 143:    */     private final String a;
/* 144:    */     private final String b;
/* 145:    */     
/* 146:    */     public RepeatedCount(@NotNull String paramString1, @NotNull String paramString2)
/* 147:    */     {
/* 148: 99 */       this.a = paramString1;
/* 149:100 */       this.b = paramString2;
/* 150:    */     }
/* 151:    */     
/* 152:    */     @NotNull
/* 153:    */     public String getMin()
/* 154:    */     {
/* 155:105 */       String tmp4_1 = this.a;
/* 156:105 */       if (tmp4_1 == null) {
/* 157:105 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl$RepeatedCount", "getMin" }));
/* 158:    */       }
/* 159:105 */       return tmp4_1;
/* 160:    */     }
/* 161:    */     
/* 162:    */     @NotNull
/* 163:    */     public String getMax()
/* 164:    */     {
/* 165:110 */       String tmp4_1 = this.b;
/* 166:110 */       if (tmp4_1 == null) {
/* 167:110 */         throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/psi/impl/RegExpQuantifierImpl$RepeatedCount", "getMax" }));
/* 168:    */       }
/* 169:110 */       return tmp4_1;
/* 170:    */     }
/* 171:    */   }
/* 172:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.lang.regexp.psi.impl.RegExpQuantifierImpl

 * JD-Core Version:    0.7.0.1

 */